package com.crazyant;


import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class Cjt_pestanas extends TabActivity {

	public Resources ressources;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.cjt_pestanas);
        
        ressources = getResources(); 
        GV.Instancies.respest = ressources;
		TabHost tabHost = getTabHost(); 
		
		// Android tab
		Intent intentAndroid = new Intent().setClass(this, Instructions.class);
		TabSpec tabSpecAndroid = tabHost
			.newTabSpec("Instructions")
			.setIndicator("Instrucciones", ressources.getDrawable(R.drawable.instructions))
			.setContent(intentAndroid);

		// Apple tab
		Intent intentApple = new Intent().setClass(this, Inventory.class);
		TabSpec tabSpecApple = tabHost
			.newTabSpec("Inventory")
			.setIndicator("Inventario", ressources.getDrawable(R.drawable.inventory))
			.setContent(intentApple);
		
		// Windows tab
		Intent intentWindows = new Intent().setClass(this, Options.class);
		TabSpec tabSpecWindows = tabHost
			.newTabSpec("Options")
			.setIndicator("Opciones", ressources.getDrawable(R.drawable.options))
			.setContent(intentWindows);
		
		// Blackberry tab
		Intent intentBerry = new Intent().setClass(this, Ranking.class);
		TabSpec tabSpecBerry = tabHost
			.newTabSpec("Ranking")
			.setIndicator("Ranking", ressources.getDrawable(R.drawable.ranking))
			.setContent(intentBerry);
	
		// add all tabs 
		tabHost.addTab(tabSpecAndroid);
		tabHost.addTab(tabSpecApple);
		tabHost.addTab(tabSpecWindows);
		tabHost.addTab(tabSpecBerry);
		
		//set Windows tab as default (zero based)
		tabHost.setCurrentTab(2);
    }
}
